<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/taglib.jsp"%>

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>BI管理门户系统</title>

		<meta name="description" content="User login page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<jsp:include page="/WEB-INF/common/head.jsp" flush="true" />
		<style type="text/css">
			.yzm-pic {
				width: 99px;
				height: 33px;
				border: 1px solid #b2cff2;
			}
		</style>
	</head>

	<link rel="stylesheet" type="text/css" href="${res_url}/css/login.css">
<script type="text/javascript">
if (self != top) {  //主页不允许在iframe中
	top.window.location.reload();
}
</script>
<div class="crm-register-bg">
  <div class="crm-register-form">
    <header class="crm-login1-header">
      <h1>对象管理系统</h1>
    </header>
    <form id="ff" class="easyui-form" method="post" action="zcurdHead/main" data-options="novalidate:true">
    <div class="crm-register-body crm-login1-body">
        <div class="crm-register-input-warpper">
          <input type="text" class="crm-register-input easyui-validatebox" data-options="required:true,validType:'length[2,20]'" value="admin" name="username" id="username" placeholder="请输入用户名" tabindex="1">
        </div>
        <div class="crm-register-input-warpper">
          <input type="password" class="crm-register-input easyui-validatebox" data-options="required:true" class="crm-register-input easyui-validatebox" value="123456" name="password" id="password" placeholder="请输入密码" tabindex="1" onfocus="">
        </div>
       
    </div>
    <div class="crm-register-footer">
      <a href="javascript:login();" class="pg-btn-submit dinline-block " tabindex="3" >登     录</a>
    </div>
    </form>
    
  </div>
</div>
<script type="text/javascript">
$(function() {
	//获取焦点样式
	$("#ff :input").focus(function() {
		$(this).parent().addClass("actived");
	}).blur(function() {
		$(this).parent().removeClass("actived");
	});
});

//回车登陆
document.onkeydown = function() {
    if(event.keyCode==13) {
    	login();
        return false;                               
    }
}



function login() {
	if($("#ff").form('enableValidation').form('validate')) {
		var param = {"username":$(":input[name='username']").val(), 
				"password":$(":input[name='password']").val(), 
		}
	      $.post("${context_path}/dologin", param, function(data) {
				if (data.code == 0) {
					window.top.location.href = "${context_path}/";
				} else {
					showWarnMsg(data.msg);
				}
			}, "json");
	}
}
</script>
     <jsp:include page="/WEB-INF/common/dialogWindow.jsp" flush="true" />
     <jsp:include page="/WEB-INF/common/foot.jsp" flush="true" />
	</body>
</html>


